import Vue from 'vue'
import App from './App.vue'
import "bootstrap/dist/css/bootstrap.css"
// 2、引入
import VueRouter from "vue-router"
import find from "./views/find.vue"
import my from "./views/my.vue"
import part from "./views/part.vue"
import NotFound from "./views/NotFound.vue"
// 3、注册
Vue.use(VueRouter)
// 4、创建路由规则数组
const routes = [
  {
    path: "/",
    redirect: "/find"
  },
  {
    path: "/find",
    component: find
  },
  {
    path: "/my/:musicName?",
    component: my,
    name: "m"
  },
  {
    path: "/part",
    component: part,
    name: "myFriend"
  },
  {
    path: "*",
    component: NotFound
  }
]
// 5、创建路由对象-传入规则
const router = new VueRouter({
  routes,
  mode: "history"
})
Vue.config.productionTip = false
// 6、关联到vue实例
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
